feat(ci): validate issue template label references#623
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a CI-enforced validation step to ensure GitHub issue templates only reference an approved set of repository labels.
Changes:
- Introduces a Python script to scan issue templates and flag unknown/deprecated labels.
- Updates issue templates to use the new label taxonomy (
type:*,area:*,priority:*). - Adds a GitHub Actions CI job and contributing docs guidance for running the validator.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/validate_issue_template_labels.py | Implements label validation for issue templates against an allowlist. |
| CONTRIBUTING.md | Documents the label taxonomy and how to run the validator locally/CI. |
| .github/workflows/ci.yml | Adds a CI job intended to run the validator. |
| .github/ISSUE_TEMPLATE/help_wanted_task.md | Replaces deprecated help wanted label with taxonomy label(s). |
| .github/ISSUE_TEMPLATE/feature_request.md | Replaces deprecated feature label with type:feature. |
| .github/ISSUE_TEMPLATE/documentation_task.md | Replaces deprecated documentation label with type:docs,area:docs. |
| .github/ISSUE_TEMPLATE/bug_report.md | Replaces deprecated bug label with type:bug. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| issue-template-label-validation: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Validate issue template labels | ||
| run: python scripts/validate_issue_template_labels.py |
| "level:advanced", | ||
| } | ||
|
|
||
| TEMPLATE_DIR = Path(".github/ISSUE_TEMPLATE") |
| for template in TEMPLATE_DIR.glob("*.md"): | ||
| content = template.read_text(encoding="utf-8") |
|
|
||
| errors = [] | ||
|
|
||
| for template in TEMPLATE_DIR.glob("*.md"): |
|
|
||
| for template in TEMPLATE_DIR.glob("*.md"): | ||
| content = template.read_text(encoding="utf-8") | ||
| match = re.search(r"^labels:\s*(.+)$", content, re.MULTILINE) |
| if not match: | ||
| continue | ||
|
|
||
| labels = [label.strip() for label in match.group(1).split(",") if label.strip()] |
utksh1
left a comment
There was a problem hiding this comment.
This cannot merge in its current form.
#606 has already merged the issue-template label taxonomy updates, and this PR now conflicts with current main (mergeable: CONFLICTING, mergeStateStatus: DIRTY). It also re-edits the same issue templates with slightly different label values, so merging it as-is would duplicate/overwrite the just-merged taxonomy work.
Please rebase on latest main and narrow this PR to the validation script, CI job, and CONTRIBUTING guidance only. Keep the already-merged template labels from main unless there is a specific reason to change them again. After conflicts are resolved and CI is green, I can re-review.
utksh1
left a comment
There was a problem hiding this comment.
Re-reviewed the latest head. This is still blocked because it overlaps the issue-template label changes already merged in #606 and should be narrowed to only the validation script, CI job, and CONTRIBUTING guidance. Please rebase on latest main and keep the already-merged template labels from main unless a specific additional change is needed.
c98ed7f to
a6c6ff2
Compare
|
Hi @utksh1, Thank you for the review. I rebased the branch on the latest main, resolved the conflicts, and removed the issue template taxonomy changes that had already been merged separately. The PR now focuses only on:
All CI checks are passing successfully. Please let me know if any further changes are required. Thank you. |
utksh1
left a comment
There was a problem hiding this comment.
Re-reviewed after the latest update and branch refresh. The PR is now scoped to the validation script, CI job, and CONTRIBUTING guidance; checks are green, so this is good to merge.
|
Approved after the latest update and fresh green CI. Manual merge is blocked by repository branch policy, and GitHub auto-merge is disabled for this repository, so I am leaving this approved instead of using admin bypass. |
|
Hi @utksh1, Thank you for the approval. I noticed the PR is still open due to the repository branch policy restrictions mentioned earlier. Just following up to check if there is anything further needed from my side to help move it forward. Thank you. |
Description
This PR adds automated validation for issue template label references and aligns existing issue templates with the repository's active label taxonomy.
Changes included:
type:*,area:*,priority:*)scripts/validate_issue_template_labels.pyto validate issue template label referencesCONTRIBUTING.mdfor updating issue template labelsRelated Issues
Fixes #579
Type of Change
How Has This Been Tested?
Checklist